<!doctype html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="heimdall" content="首页">
    <title>三鑫灯世界 - 首页</title>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/header.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/c.css" />
    <link href="__PUBLIC__/css/ma5slider.min.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
    <script src="__PUBLIC__/js/jquery-ui.min.js"></script>
    <script src="__PUBLIC__/js/ma5slider.min.js"></script>
    <style>
        .slide-area {
            height: 384px;
        }
        .ma5slider .slide img{
            height: 384px;
        }

        .yuanpice{font-size: 14px;color: #666;text-decoration:line-through;}
    </style>
</head>

<body>
<!--公共头部-->
<include file="./Application/Home/View/Public/head.html"/>

<div class="container module" style="margin-top: 50px;">
    <if condition="$search eq ''">
        <div class="time-img">
            <h3>{$good_cate_name}</h3>
        </div>
    </if>
    <div class="mc" style="margin-bottom: 50px;">
        <div class="sittingBox">
            <div class="pc-goods">
                <div class="mc-goods" style="background: #fff">
                    <input type="hidden" value="{$cate_id}" id="cate_id">
                    <input type="hidden" id="page" value="2">
                    <volist name="list" id="li">
                        <a class="hot ng-scope first" href="{:U('shop_details')}?id={$li.good_id}">
                            <div class="pic">
                                <img width="260" height="260" src="__ROOT__{$li.picture}">
                            </div>
                            <p class="money ng-scope">
                                <if condition="session('user_vip') eq 1">
                                    <span class="ng-binding ng-scope">￥{$li.vip_price}</span>
                                    <span class="yuanpice">￥{$li.price}</span>
                                    <else />
                                    <span class="ng-binding ng-scope">￥{$li.price}</span>
                                </if>
                            </p>
                            <h5 class="goods-name ng-binding" >{$li.good_name}</h5>
                        </a>
                    </volist>
                </div>
                <div style="clear: both"></div>
            </div>
        </div>
    </div>
</div>

<!--引入公共的底部-->
<include file="./Application/Home/View/Public/footer.html"/>

<script>
    $('.side-nav').find('.side-ul').hide();
    $('.side-nav').hover(function(){
        $(this).find('.side-ul').show();
    },function(){
        $(this).find('.side-ul').hide();
    })
    $('.side-ul> li').hover(function(){
        $(this).css('background','#fff').find('a:first-child').css('color','#000');
        $(this).find('.nav-items').show();
    },function(){
        $(this).css('background','#4f4f4f').find('a:first-child').css('color','#fff');
        $(this).find('.nav-items').hide();
    })
</script>

<!--如果存在搜索值，默认不出发滚动条事件-->
<if condition="$search eq ''">
    <!--商品瀑布流-->
    <script type="text/javascript">
        var tur = true;
        var wh=$(document).height();
        var pages = $('#page').val();
        var cate_id = $('#cate_id').val();
        $(window).scroll(scrolldemo)
        function scrolldemo(){
            var s=wh-$(window).scrollTop();
            if(tur && s<=1400){
                setTimeout(function() {
                    $.ajax({
                        url:"{:U('upData')}",
                        data:{
                            'page':pages,
                            'cate_id':cate_id
                        },
                        type:'post',
                        async:false,
                        success:function (e) {
                            console.log(e)
                            if(e == -1){
                                $(window).off("scroll",scrolldemo);//清除滚动条定时事件
                            }
                            var da = JSON.parse(e);
                            var repaly = '';
                            for (var i=0;i<da.length;i++){
                                repaly += '<a class="hot ng-scope first" href="{:U(shop_details)}?id='+da[i].good_id+'">'
                                        +'<div class="pic">'
                                        +'<img width="260" height="260" src="__ROOT__'+da[i].picture+'">'
                                        +'</div>'
                                        +'<p class="money ng-scope">'
                                        +'<if condition="session(user_vip) eq 1">'
                                        +'<span class="ng-binding ng-scope">￥'+da[i].vip_price+'</span>&nbsp;'
                                        +'<span class="yuanpice">￥'+da[i].price+'</span>'
                                        +'<else />'
                                        +'<span class="ng-binding ng-scope">￥'+da[i].price+'</span>'
                                        +'</if>'
                                        +'</p>'
                                        +'<h5 class="goods-name ng-binding" >'+da[i].good_name+'</h5>'
                                        +'</a>'
                            }
                            $('.mc-goods').append(repaly);
                            pages++;
                            $('#page').val(pages);
                        }
                    });
                    tur = true;
                }, 1000);
                tur = false;
            }
        }
    </script>
    </if>
</body>
</html>